<?php
$htmlOptions = array(
  'id'    => 'search-box',
  'class' => 'content-box',
  'style' => '',
);

if (SpsState::hasState('search'))
    $htmlOptions['style'] = 'background:#e5ecf9 none;border:1px solid #aac6e8;';
else
    $htmlOptions['style'] = 'background:#e5ecf9 none;border:1px solid #aac6e8;display:none;';

echo CHtml::openTag('div', $htmlOptions);
?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'action'      => Yii::app()->createUrl($this->route),
    'method'      => 'get',
    'id'          => 'search-form',
    'htmlOptions' => array('class' => 'form'),
    ));
?>
<ul>
    <li>
        <?php
        $attr   = 'email';
        echo $form->label($model, $attr, array('class' => 'search-label'));
        echo $form->textField($model, $attr, array('class' => 'text medium'));
        ?>
    </li>
    <li>
        <?php
        $attr   = 'date';
        echo $form->label($model, $attr, array('class' => 'search-label'));
        
        $this->widget('ext.mylib.widgets.Datepicker.DDatePicker', array(
            'model'       => $model,
            'attribute'   => 'startDate',
            'htmlOptions' => array(
                'class' => 'text normal'
            ),
        ));
        echo '&nbsp;-&nbsp;';
        $this->widget('ext.mylib.widgets.Datepicker.DDatePicker', array(
            'model'       => $model,
            'attribute'   => 'endDate',
            'htmlOptions' => array(
                'class' => 'text normal'
            ),
        ));
        ?>
    </li>

    <li>
        <div style="margin:auto; width:75px;">
            <?php
            echo CHtml::link(
              '<span class="ui-icon ui-icon-arrowreturn-1-e"></span>SUBMIT', 'javascript:void(0)', array(
              'id'    => 'btn-submit',
              'class' => 'btn ui-state-default ui-corner-all',
              )
            )
            ?>
        </div>
    </li>
</ul>
<?php $this->endWidget(); ?>
<?php echo CHtml::closeTag('div'); ?>